package day10;

public class Homework1{
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            String name=Thread.currentThread().getName();
            int multiple1;
            System.out.println("2的倍数有:");
            for(int i=1;i<=100;i++){
                if(i%2==0){
                    multiple1=i;
                    System.out.print(multiple1+", ");
                }
            }
            System.out.println("");
        },"A");
        Thread t2=new Thread(()->{
            String name=Thread.currentThread().getName();
            int multiple2;
            System.out.println("3的倍数有:");
            for(int i=1;i<=100;i++){
                if(i%3==0){
                    multiple2=i;
                    System.out.print(multiple2+", ");
                }
            }
            System.out.println("");
        },"B");
        Thread t3=new Thread(()->{
            String name=Thread.currentThread().getName();
            int multiple3;
            System.out.println("5的倍数有:");
            for(int i=1;i<=100;i++){
                if(i%5==0){
                    multiple3=i;
                    System.out.print(multiple3+", ");
                }
            }
        },"C");
        t1.start();
        t1.join();
        t2.start();
        t2.join();
        t3.start();
        t3.join();
    }
}
